/********************************************************************
	created:	2008/12/20
	created:	20:12:2008   0:03
	filename: 	g:\Projects On Develop\board-game\protype\BattleLine\BattleLine\GameBattleLine.cpp
	file path:	g:\Projects On Develop\board-game\protype\BattleLine\BattleLine
	file base:	GameBattleLine
	file ext:	cpp
	author:		Ray Xi
	
	purpose:	The logic of board game Battle Line class
*********************************************************************/

#include "GameBattleLine.h"
#include "BattleLineCardManager.h"
#include "BattleLineChessmanManager.h"
#include "BattleLineRegionManager.h"

CGameBattleLine::CGameBattleLine()
{

}

CGameBattleLine::~CGameBattleLine()
{

}

void CGameBattleLine::Init()
{	

}

void CGameBattleLine::Update(float fTime)
{

}

void CGameBattleLine::Render()
{

}

void CGameBattleLine::Deinit()
{

}

void CGameBattleLine::InitAssets()
{
	CGameEntityAsset* pAsset;
	pAsset = new CBattleLineCardManager;
	m_oEntityAssetList.push_back(pAsset);

	pAsset = new CBattleLineChessmanManager;
	m_oEntityAssetList.push_back(pAsset);

	pAsset = new CBattleLineRegionManager;
	m_oEntityAssetList.push_back(pAsset);

	for(list<CGameEntityAsset*>::iterator it = m_oEntityAssetList.begin();it != m_oEntityAssetList.end();it++)
	{
		(*it)->Init();		
	}
}

void CGameBattleLine::DeinitAssets()
{
	for(list<CGameEntityAsset*>::iterator it = m_oEntityAssetList.begin();it != m_oEntityAssetList.end();it++)
	{
		(*it)->Deinit();
		delete (*it);
	}
	m_oEntityAssetList.clear();
}

void CGameBattleLine::UpdateAssets(float fTime)
{
	for(list<CGameEntityAsset*>::iterator it = m_oEntityAssetList.begin();it != m_oEntityAssetList.end();it++)
	{
		(*it)->Update(fTime);
	}
}

void CGameBattleLine::RenderAssets()
{
	for(list<CGameEntityAsset*>::iterator it = m_oEntityAssetList.begin();it != m_oEntityAssetList.end();it++)
	{
		(*it)->Render();
	}
}